package main

import (
	"github.com/micro/go-micro"
	"github.com/micro/go-micro/registry"
	"github.com/micro/go-plugins/registry/etcdv3"
	"goMicro/day06/services"
	"goMicro/day06/servicesImpl"
)

func main() {
	etcdReg := etcdv3.NewRegistry(
		registry.Addrs("127.0.0.1:2379"),
	)
	//此种方式 ，可以以micro json,http,等多种方式访问
	microServer := micro.NewService(
		micro.Name("api.jtthink.com.test"),
		micro.Address(":8081"),
		micro.Registry(etcdReg),
	)
	microServer.Init()
	services.RegisterTestServiceHandler(microServer.Server(), new(servicesImpl.TestService))
	services.RegisterUserServiceHandler(microServer.Server(), new(servicesImpl.UserService))
	microServer.Run()

}
